package com.cskaoyan.controller.wx;

import com.cskaoyan.bean.BaseRespVo;
import com.cskaoyan.bean.wx.WxTopic;
import com.cskaoyan.bean.wx.WxTopicDetail;
import com.cskaoyan.bean.wx.WxTopicListBean;
import com.cskaoyan.service.wx.WxTopicService;
import com.fasterxml.jackson.databind.ser.Serializers;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("wx/topic/")
public class WxTopicController {

    @Autowired
    WxTopicService wxTopicService;

    @RequestMapping("list")
    public BaseRespVo wxTopicList(Integer page, Integer size){
        WxTopicListBean wxTopicListBean = wxTopicService.queryWxTopicListBean(page,size);
        return BaseRespVo.ok(wxTopicListBean);
    }

    @RequestMapping("detail")
    public BaseRespVo wxTopicDetail(Integer id){
        WxTopicDetail topic = wxTopicService.queryWxTopicDetailById(id);
        return BaseRespVo.ok(topic);
    }

    @RequestMapping("related")
    public BaseRespVo wxTopicRelated(Integer id){
        List list = wxTopicService.queryWxTopicRelatedById(id);
        return BaseRespVo.ok(list);
    }

}
